<!DOCTYPE html>
<html>
    <head>
        <title>Mathlearner</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <!--<meta name="viewport" content="width=device-width, initial-scale=1">-->
        <script type="text/x-mathjax-config">
            MathJax.Hub.Config({
                extensions: ["tex2jax.js"],
                jax: ["input/TeX","output/HTML-CSS"],
                tex2jax: {inlineMath: [["$","$"],["\\(","\\)"]]}
            });

        </script> 
        <script type="text/javascript" src="core/config.js"></script>
        <script type="text/javascript" src="core/mathtestlib.js"></script>
        <script type="text/javascript" src="tasks/algebra/determinant/task.js"></script>
        <script type="text/javascript" src="core/utils.js"></script>

        <script type="text/javascript">
            var loc = getParameters(location.search.substring(1))['lang'];
            var djConfig = { modulePaths: {"mathlearner": "../.."},
                parseOnLoad: true,
                locale: loc};
        </script>
        <script type="text/javascript" src="dojo/dojo/dojo.js"></script>
        <script type="text/javascript">
            require(["dojo/string", 
                    "dojo/i18n", 
                    "dijit/layout/ContentPane"]);
        </script>

    </head>
    <body>
        <script type="text/javascript">

            getMess = function(mess) {
                var nlsStrings; 
                var resStr;
                require(["dojo/i18n!mathlearner/nls/" + mess.res], function(i18n){
                        resStr = i18n[mess.name];
                        });
                if (mess.pars) {
                    resStr = dojo.string.substitute(resStr, mess.pars);
                }
                return resStr;
            }

            function renderTask() {
                t = new TaskDeterminant();
                var dim = 4; 
                var r = 2;  
                t.generate(dim, r);
                document.write("<h2>Задача</h2>");
                document.write(getMess(t.taskStr));
                document.write("<h2>Решение</h2>");
                var nStep = 1;
                while (!t.solved) {
                    t.nextStep();
                    var stepID = "step" + nStep;
                    require(["dijit/Tooltip", "dojo/parser", "dojo/domReady!"], function(Tooltip){
                    var v = new Tooltip({
                        connectId: ['test'],
                        label: /*getMess(lastOf(t.steps)).hint*/ 'test'});
                    });
                    

                    document.write(getMess(lastOf(t.steps).message));
                    document.write("<span id='" + stepID + "'>" + getMess(lastOf(t.steps).result) + "</span>");
                }
            }
        </script>


<script type="text/javascript">
require(["dijit/layout/BorderContainer", "dijit/layout/ContentPane", "dojo/parser"]);
</script>


<!--<div
            id="appLayout" class="demoLayout"
            data-dojo-type="dijit.layout.BorderContainer"
            data-dojo-props="design: 'headline'">
        <div
                class="centerPanel"
                data-dojo-type="dijit.layout.ContentPane"
                data-dojo-props="region: 'center'">
            <div>
                <h4>Group 1 Content</h4>
                <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
            </div>
            <div>
                <h4>Group 2 Content</h4>
            </div>
            <div>
                <h4>Group 3 Content</h4>
            </div>
        </div>
        <div
                class="edgePanel"
                data-dojo-type="dijit.layout.ContentPane"
                data-dojo-props="region: 'top'">Header content (top)</div>
        <div
            id="leftCol" class="edgePanel"
            data-dojo-type="dijit.layout.ContentPane"
            data-dojo-props="region: 'left', splitter: true">Sidebar content (left)</div>
    </div>-->



<a href = '?lang=ru'>Russian</a>
<a href = '?lang=en'>English</a>
<script type="text/javascript">
    renderTask();
</script>

<div id = "taskpane"></div>

<!--<script type="text/javascript">
    var panediv = dojo.byId('taskpane');
    var pane = new dijit.layout.ContentPane({ href: "task.html", preload: true}, panediv); 
</script>-->

</div>
</body>
</html>

